package com.inforich.app.api.controller.building;

import com.inforich.building.domain.BuildingType;
import com.inforich.building.service.IBuildingTypeService;
import com.inforich.common.core.domain.AjaxResult;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: some desc
 * @author: HJM
 * @date: 2022/10/29
 */
@RestController
@RequestMapping("/h5api/building/BuildingType")
public class AppBuildingTypeController {

  @Autowired
  private IBuildingTypeService buildingTypeService;

  /**
   * 树
   */
  @GetMapping("/tree")
  public AjaxResult selectBuildingTypeTreeListByCode() {
    List<BuildingType> list = buildingTypeService.list();
    return AjaxResult.success(buildingTypeService.selectBuildingTypeTreeList(list));
  }
}
